package beans;

import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.Message.RecipientType;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import com.sun.mail.smtp.SMTPSSLTransport;

public class SendMailSvc {


public String sendTempAlertEmail(double temp)
{
	String from = "asoa0838@gmail.com";
	String to = "sameeksha.shetty@gmail.com";
	String password = "asoa0838asoa0838";
	String subject = "High Temperature Alert";
	String message = "Current body temperature is: " +temp;
	SendMail sendMail = new SendMail(from, to, subject, message,password);
	System.out.println("Mail has been sent to : " + to);
	sendMail.send();
	return "Mail has been sent to : " + to;
}

public String sendHBRAlertEmail(double temp)
{
	String from = "asoa0838@gmail.com";
	String to = "anwara.ahmed@gmail.com";
	String password = "asoa0838asoa0838";
	String subject = "High HBR Alert";
	String message = "Current HBR is: " +temp;
	SendMail sendMail = new SendMail(from, to, subject, message,password);
	System.out.println("Mail has been sent to : " + to);
	sendMail.send();
	return "Mail has been sent to : " + to;
}
}
